package com.test.list2tree;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.List;
import java.util.Objects;

@Data
public class Structure {

    private String id;
    @JsonProperty("pId")
    private String pid;
    private String level;
    private String name;
    private String code;
    private String leaf;
    private List<Structure> children;

    public boolean hasChildren() {
        return Objects.equals(leaf, "0");
    }
}
